-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Dockerfile #5
Conversation
Was getting segfaults with Alpine image for some reason.
I just pushed a commit switching from Alpine to Debian as the base of the Docker image. When using Alpine, the image worked for simple
The program died immediately after those two lines with exit code 139 (segfault). I'm not super familiar with Rust, so if you have any idea what would cause those segfaults I can change it back (and save a few hundred MB), but for now I'll just use the Debian base image since that doesn't crash. |
I've seen some decent rust Docker files recently, but haven't experimented
a lot. Most people seem to use a build step and a deploy step - which I
believe can bring the image size right down.
On 30 April 2023 at 2:09:40 am, Scott Weldon ***@***.***) wrote:
I just pushed a commit switching from Alpine to Debian as the base of the
Docker image.
When using Alpine, the image worked for simple --help output, but when I
tried to connect to any relay, I got the following (with RUST_LOG set to
debug):
[2023-04-29T22:21:10Z INFO nostcat] Spawning thread for --
wss://nostr.bitcoiner.social/
[2023-04-29T22:21:10Z DEBUG tungstenite::client] Trying to contact
wss://nostr.bitcoiner.social/ at 23.146.144.108:443...
The program died immediately after those two lines with exit code 139
(segfault).
I'm not super familiar with Rust, so if you have any idea what would cause
those segfaults I can change it back (and save a few hundred MB), but for
now I'll just use the Debian base image since that doesn't crash.
—
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADILOSUXIFYOYGAUPUHRGTXDWNTJANCNFSM6AAAAAAXQPIQH4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Oh good idea, building in Debian and running in Alpine might work. I tried that briefly, but I'm having some trouble hooking up the dynamically-linked libraries at present; I'll troubleshoot a bit more and see if I can make that work. If you want to merge this PR, I can open a new one if/when I get it working. Otherwise I'll just push another commit to this one. |
@501st-alpha1 I've spent some time to get a compact and functional Docker image, and I think I have something that's decent. It's only 30mb. If you're able to give it a go (instructions at bottom on README.md and let me know how it goes. RE: #6 If you can also try testing it using torify. I was unable to find a nostr tor relay that was functional, so if you'd like me to test, can you share the tor onion url? Connecting to tor onion relays $ echo '["REQ", "RAND", {"kinds": [1], "limit": 2}]' | torify nostcat wss://TOR_URL.onion In testing, I found the dependencies seemed to use a mix of dynamic and static openssl support - which was likely the cause of the segfault. |
I tested it and it works great, thanks! I'll close this PR.
Yes, my workaround to connect to
You should have read-only access to the onion listed there. To explain some of the other args (just in case):
Thanks again! |
@blakejakopovic If this is the only tor solution, why was this not merged? |
@dskvr See this comment; a |
I've added a Dockerfile so that nostcat can be built and run in a Docker container, in case e.g. one doesn't want to install Rust on their host OS.